#include"shm.hpp"
#include"NamedPipe.hpp"

int main()
{
    //创建共享内存
    Shm shm(gpathname, gproj_id, gUser);
    shm.Zero();
    char* shmaddr = (char*)shm.Addr();

    //2.打开管道
    NamedPipe fifo(comm_path, User);
    fifo.OpenForWrite();

    //当成string
    char ch = 'A';
    while(ch <= 'Z')
    {
        shmaddr[ch - 'A'] = ch;
        
        std::string temp = "wakeup";
        std::cout << "add " << ch << " into Shm, " << "wakeup reader" << std::endl;
        fifo.WriteNamedPipe(temp);

        sleep(2);
        ch++;
    }
    sleep(5);
    return 0;
}